1212. No restriction on the exercise of the right to dispose of property may be stipulated, except by gift or will.
A stipulation of inalienability is made in writing at the time of transfer of ownership of the property or a dismembered right of ownership in it to a person or to a trust.
The stipulation of inalienability is valid only if it is temporary and justified by a serious and legitimate interest. Nevertheless, it may be valid for the duration of a substitution or trust.